package TestDemo9;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Test {
    public static int singleNumber(int[] nums) {
        int result=0;
        Set<Integer> set=new TreeSet<>();
        for(int i =0 ;i<nums.length;i++){
            if(!set.contains(nums[i])){
                set.add(nums[i]);
            }else{
                set.remove(nums[i]);
            }
        }
        for (int i = 0; i < nums.length; i++) {
            if(set.contains(nums[i])){
                return nums[i];
            }
        }
        return -1;


    }
    public static void main(String[] args) {
        int[] arr={30000,500,100,30000,100,30000,100};
        int ans=singleNumber(arr);
        System.out.println(ans);
    }
    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        //行
        int w=sc.nextInt();
        //列
        int h=sc.nextInt();
        int count=0;
        int[][] arr=new int[w][h];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[0].length; j++) {
                arr[i][j]=1;
            }
        }

        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[0].length; j++) {
                if(arr[i][j] != 0){
                    count++;
                    if(i+2 < arr.length){
                        arr[i+2][j]=0;
                    }
                    if(j+2 < arr[0].length){
                        arr[i][j+2]=0;
                    }
                }
            }
        }
        System.out.println(count);
    }

}
